//
//  XKHomeFunctionCell.m
//  xk100
//
//  Created by xiaokang on 2017/5/17.
//  Copyright © 2017年 xiaokang. All rights reserved.
//

#import "XKHomeFunctionCell.h"

@interface XKHomeFunctionCell ()
@property (nonatomic, strong) UIImageView   *imgView;
@property (nonatomic, strong) UILabel       *label;
@end

@implementation XKHomeFunctionCell
    
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = WhiteColor;
        
        self.imgView = [[UIImageView alloc]init];
        self.imgView.image = [UIImage imageNamed:@"index_con_icon_trade"];
        [self.contentView addSubview:self.imgView];
        [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.mas_equalTo(self.contentView);
            make.centerY.mas_equalTo(self.contentView).offset(-12);
            make.size.mas_equalTo(CGSizeMake(38, 38));
        }];
        
        self.label = [UILabel getLabWithText:@"新闻测试" textFont:Font_13 textColor:BlackColor textAlignment:NSTextAlignmentCenter];
        [self.contentView addSubview:self.label];
        [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.contentView).offset(5);
            make.right.mas_equalTo(self.contentView).offset(-5);
            make.bottom.mas_equalTo(self.contentView).offset(-15).priorityHigh();
        }];
    }
    return self;
}

- (void)setImageName:(NSString *)imageName {
    _imageName = imageName;
    self.imgView.image = [UIImage imageNamed:imageName];
}
- (void)setTitleName:(NSString *)titleName {
    _titleName = titleName;
    self.label.text = titleName;
}

@end
